Skip to content

cli: Add tag-aware upgrade operations#2094

Merged
cgwalters merged 1 commit intobootc-dev:mainfrom
gursewak1997:add-tag-upgrade
Mar 30, 2026
Merged

cli: Add tag-aware upgrade operations#2094
cgwalters merged 1 commit intobootc-dev:mainfrom
gursewak1997:add-tag-upgrade

Conversation

@gursewak1997
Copy link
Copy Markdown
Contributor

@gursewak1997 gursewak1997 commented Mar 24, 2026

Implements bootc upgrade --tag <TAG> to upgrade to a different tag
of the current image without typing the full registry path.

Implementation:

  • Added ImageReference::with_tag() method in spec.rs
  • Uses OCI Reference API for registry and containers-storage transports
  • Falls back to string manipulation for oci: and other complex transports
  • Properly strips digests when replacing tags
  • Works with all transport types

Testing:

  • Unit tests cover registry, containers-storage, digest handling, and edge cases
  • Integration test (test-upgrade-tag.nu) uses containers-storage to verify
    full tag-switching workflow across reboots without registry dependency

@github-actions github-actions bot added the area/documentation Updates to the documentation label Mar 24, 2026
@bootc-bot bootc-bot bot requested a review from jmarrero March 24, 2026 22:57
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces new bootc upgrade CLI options: --tag to specify a target image tag for an upgrade, and --list-tags to display available tags for the currently booted image's repository. It includes new helper functions derive_image_with_tag and list_tags_for_current_image to support this functionality, along with corresponding unit tests and documentation updates. A review comment suggests refactoring duplicated logic within the upgrade function for retrieving the current image and handling cases where it's not defined, as well as making error messages more specific.

@gursewak1997 gursewak1997 force-pushed the add-tag-upgrade branch 3 times, most recently from 4c5ca28 to c7274c6 Compare March 25, 2026 20:07
@gursewak1997 gursewak1997 force-pushed the add-tag-upgrade branch 6 times, most recently from 74468cf to 9a90db8 Compare March 29, 2026 20:30
Implements bootc upgrade --tag <TAG> to upgrade to a different tag
of the current image without typing the full registry path.

Implementation:
- Added ImageReference::with_tag() method in spec.rs
- Uses OCI Reference API for registry and containers-storage transports
- Falls back to string manipulation for oci: and other complex transports
- Properly strips digests when replacing tags
- Works with all transport types

Testing:
- Unit tests cover registry, containers-storage, digest handling, and edge cases
- Integration test (test-upgrade-tag.nu) uses containers-storage to verify
  full tag-switching workflow across reboots without registry dependency

Documentation updated with --tag examples.

Assisted-by: Claude (Sonnet 4.5)
Signed-off-by: gursewak1997 <gursmangat@gmail.com>
@cgwalters cgwalters merged commit 7d0cfe6 into bootc-dev:main Mar 30, 2026
61 of 65 checks passed
@gursewak1997 gursewak1997 deleted the add-tag-upgrade branch March 30, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/documentation Updates to the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants